package com.xbongbong.saas.domain.dao;

import com.xbongbong.pro.domain.entity.PriorityUpdateEntity;
import com.xbongbong.saas.domain.entity.ClueAutoAllocationEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface ClueAutoAllocationDao {

    /**
     * 新建
     *
     * @param clueAutoAllocationEntity
     */
    Integer insert(ClueAutoAllocationEntity clueAutoAllocationEntity);

    /**
     * 更新
     *
     * @param clueAutoAllocationEntity
     */
    Integer update(ClueAutoAllocationEntity clueAutoAllocationEntity);

    Integer updateBatchSursplus(@Param("list") List<ClueAutoAllocationEntity> list, @Param("corpid") String corpid);

    /**
     * 获取规则
     *
     * @param key
     * @param corpid
     */
    ClueAutoAllocationEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer updateDelByModelType(@Param("del") Integer del, @Param("corpid") String corpid, @Param("modelType") Integer modelType);

    /**
     *
     * @param param
     */
    List<ClueAutoAllocationEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    Integer sort(@Param("list") List<PriorityUpdateEntity> entities, @Param("corpid") String corpid);

    void insertBatch(@Param("list") List<ClueAutoAllocationEntity> list);
}
